package com.gudy.counter.service.impl;

import com.gudy.counter.bean.CounterRes;
import com.gudy.counter.bean.PosiInfo;
import com.gudy.counter.service.PosiSerivce;
import com.gudy.counter.util.ConstCommon;
import com.gudy.counter.util.DBUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PosiSerivceImpl implements PosiSerivce {
    @Autowired
    DBUtil dbUtil;


    @Override
    public CounterRes queryPosiInfo(long uid) {
        List<PosiInfo> posiInfoList = DBUtil.queryPosiInfo(uid);
        if (posiInfoList.size() <= 0 ){
            return new CounterRes(ConstCommon.RELOGIN,"用户持仓获取失败",null);
        }
        return new CounterRes(ConstCommon.SUCCESS,"用户持仓获取成功",posiInfoList);
    }
}
